package com.xbongbong.paas.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.constant.FieldAttrConstant;
import com.xbongbong.saas.enums.XbbRefTypeEnum;
import com.xbongbong.saas.enums.business.ContactEnum;
import com.xbongbong.saas.enums.business.ContractEnum;
import com.xbongbong.saas.enums.business.ContractPerformanceEnum;
import com.xbongbong.saas.enums.business.CustomerCommunicateEnum;
import com.xbongbong.saas.enums.business.InstockEnum;
import com.xbongbong.saas.enums.business.InvoiceEnum;
import com.xbongbong.saas.enums.business.OutstockEnum;
import com.xbongbong.saas.enums.business.PaymentSheetEnum;
import com.xbongbong.saas.enums.business.PurchaseEnum;
import com.xbongbong.saas.enums.business.QuotationEnum;
import com.xbongbong.saas.enums.business.ReturnedPurchaseEnum;
import com.xbongbong.saas.enums.business.SalesOpportunityEnum;
import com.xbongbong.saas.enums.business.WorkOrderEnum;
import lombok.Getter;

/**
 * 三项的后两项位置在程序里纠正
 *
 * @author 梁鲁江
 * @version v1.0
 * @date 2019/2/25 14:42
 * @since v1.0
 */
@Getter
public enum BiLinkEnum {
    /**
     * 客户作为主表
     */
    IDX_STATISTIC_CUSTOMER_OPP(209, "enum.biLink.name.idx_statistic_customer_opp", XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_" + XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(),
            "{\"" + XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "\": { \"" + FieldAttrConstant.ATTR + "\":\"" + FieldTypeEnum.DATAID .getAlias() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType() +
                    "},\"" + XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + SalesOpportunityEnum.CUSTOMER_NAME .getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +
                    SalesOpportunityEnum.CUSTOMER_NAME .getFieldType()+ "}}"),
    IDX_STATISTIC_CUSTOMER_COMMUNICATE(210, "enum.biLink.name.idx_statistic_customer_communicate", XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_" + XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode(),
            "{\"" + XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "\": { \"" + FieldAttrConstant.ATTR + "\":\"" + FieldTypeEnum.DATAID .getAlias() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType() +
                    "},\"" + XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + CustomerCommunicateEnum.CUSTOMER_NAME.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +
                    CustomerCommunicateEnum.CUSTOMER_NAME .getFieldType()+ "}}"),
    IDX_STATISTIC_CUSTOMER_CONTRACT(211, "enum.biLink.name.idx_statistic_customer_contract", XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_" + XbbRefTypeEnum.CONTRACT.getCode(),
            "{\"" + XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "\": { \"" + FieldAttrConstant.ATTR + "\":\"" + FieldTypeEnum.DATAID .getAlias() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType() +
                    "},\"" + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ContractEnum.LINK_CUSTOMER.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +
                        ContractEnum.LINK_CUSTOMER.getFieldType()+ "}}"),
/*    IDX_STATISTIC_CUSTOMER_PAYMENT(212, "idx_statistic_customer_payment", "customer_payment", "客户、回款", XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_" + XbbRefTypeEnum.PAYMENT_SHEET.getCode(), -1"{\"" + XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "\": { \"" + FieldAttrConstant.ATTR + "\":\"" + FieldTypeEnum.DATAID .getAlias() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType() +
            "},\"" + XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + SalesOpportunityEnum.CUSTOMER_NAME .getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +
            SalesOpportunityEnum.CUSTOMER_NAME .getFieldType()+ "}}"),*/
    IDX_STATISTIC_CUSTOMER_INVOICE(213, "enum.biLink.name.idx_statistic_customer_invoice", XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_" + XbbRefTypeEnum.INVOICE.getCode(),
            "{\"" + XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "\": { \"" + FieldAttrConstant.ATTR + "\":\"" + FieldTypeEnum.DATAID .getAlias() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType() +
                    "},\"" + XbbRefTypeEnum.INVOICE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + InvoiceEnum.CUSTOMER_NAME .getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +
                    InvoiceEnum.CUSTOMER_NAME .getFieldType()+ "}}"),
    IDX_STATISTIC_CUSTOMER_WORKORDER(214, "enum.biLink.name.idx_statistic_customer_workorder", XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_" + XbbRefTypeEnum.WORK_ORDER.getCode(),
            "{\"" + XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "\": { \"" + FieldAttrConstant.ATTR + "\":\"" + FieldTypeEnum.DATAID .getAlias() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType() +
                    "},\"" + XbbRefTypeEnum.WORK_ORDER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + WorkOrderEnum.LINK_CUSTOMER.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +
                    WorkOrderEnum.LINK_CUSTOMER.getFieldType()+ "}}"),
    IDX_STATISTIC_CUSTOMER_CONTACT(215, "enum.biLink.name.idx_statistic_customer_contact", XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_" + XbbRefTypeEnum.CONTACT.getCode(),
            "{\"" + XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "\": { \"" + FieldAttrConstant.ATTR + "\":\"" + FieldTypeEnum.DATAID .getAlias() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType() +
                    "},\"" + XbbRefTypeEnum.CONTACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ContactEnum.CUSTOMER_NAME .getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +
                    ContactEnum.CUSTOMER_NAME .getFieldType()+ "}}"),
    /**
     * 合同作为主表
     */
    IDX_STATISTIC_CONTRACT_OPP(307, "enum.biLink.name.idx_statistic_contract_opp", XbbRefTypeEnum.CONTRACT.getCode() + "_" + XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(),
            "{\"" + XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "\": { \"" + FieldAttrConstant.ATTR + "\":\"" + FieldTypeEnum.DATAID .getAlias() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType() + "},\""
                    + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ContractEnum.LINK_OPPORTUNITY .getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + ContractEnum.LINK_OPPORTUNITY .getFieldType()+ "}" +
                    "}"),
    IDX_STATISTIC_CONTRACT_PAYMENT_SHEET(309, "enum.biLink.name.idx_statistic_contract_payment_sheet", XbbRefTypeEnum.CONTRACT.getCode() + "_" + XbbRefTypeEnum.PAYMENT_SHEET.getCode(),
            "{\"" + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                + XbbRefTypeEnum.PAYMENT_SHEET.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + PaymentSheetEnum.CONTRACT.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + PaymentSheetEnum.CONTRACT .getFieldType()+ "}" +
                "}"),
    IDX_STATISTIC_CONTRACT_INVOICE(310, "enum.biLink.name.idx_statistic_contract_invoice", XbbRefTypeEnum.CONTRACT.getCode() + "_" + XbbRefTypeEnum.INVOICE.getCode(),
            "{\"" + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.INVOICE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + InvoiceEnum.CONTRACT_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + InvoiceEnum.CONTRACT_ID.getFieldType()+ "}" +
                    "}"),
    IDX_STATISTIC_CONTRACT_WORK_ORDER(311, "enum.biLink.name.idx_statistic_contract_work_order", XbbRefTypeEnum.CONTRACT.getCode() + "_" + XbbRefTypeEnum.WORK_ORDER.getCode(),
            "{\"" + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.WORK_ORDER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + WorkOrderEnum.LINK_CONTRACT.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + WorkOrderEnum.LINK_CONTRACT.getFieldType()+ "}" +
                    "}"),

    IDX_STATISTIC_CONTRACT_QUOTATION(312, "enum.biLink.name.idx_statistic_contract_quotation", XbbRefTypeEnum.CONTRACT.getCode() + "_" + XbbRefTypeEnum.QUOTATION.getCode(),
            "{\"" + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  ContractEnum.QUOTATION_ID.getAttr()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + ContractEnum.QUOTATION_ID.getFieldType()+ "},\"" +
                    + XbbRefTypeEnum.QUOTATION.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + FieldTypeEnum.DATAID .getAlias() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "}" +
                    "}"),
    //TODO　　要特殊处理
/*    IDX_STATISTIC_CONTRACT_INSTOCK(312, "合同、入库单", XbbRefTypeEnum.CONTRACT.getCode() + "_" + XbbRefTypeEnum.INSTOCK.getCode(),
            "{\"" + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.INSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + InstockEnum.REF_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + InstockEnum.REF_ID.getFieldType()+ "}" +
                    "}"),*/
    //TODO　　要特殊处理
    IDX_STATISTIC_CONTRACT_OUTSTOCK(313, "enum.biLink.name.idx_statistic_contract_outstock", XbbRefTypeEnum.CONTRACT.getCode() + "_" + XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(),
            "{\"" + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + OutstockEnum.REF_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + OutstockEnum.REF_ID.getFieldType()+ "}" +
                       "}"),
    /**
     * 业绩分配+合同
     */
    IDX_STATISTIC_CONTRACT_PERFORMANCE(314, "enum.biLink.name.idx_statistic_contract_performance", XbbRefTypeEnum.CONTRACT_PERFORMANCE.getCode() + "_" + XbbRefTypeEnum.CONTRACT.getCode(),
            "{\"" + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.CONTRACT_PERFORMANCE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ContractPerformanceEnum.CONTRACT_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + ContractPerformanceEnum.CONTRACT_ID.getFieldType()+ "}" +
                    "}"),
    //
    /**
     * 机会 作为主表
     */
//    IDX_STATISTIC_OPP_COMMUNICATE(406, "idx_statistic_opp_communicate", "opp_communicate", "机会、跟进记录", XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_" + XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode(), -1),
//    IDX_STATISTIC_OPP_INVOICE(408, "机会、发票", XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_" + XbbRefTypeEnum.INVOICE.getCode(), -1),
//    IDX_STATISTIC_OPP_WORKORDER(409, "idx_statistic_opp_workorder", "opp_workorder", "机会、工单", XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_" + XbbRefTypeEnum.WORK_ORDER.getCode(), -1),
            //TODO
    IDX_STATISTIC_OPP_PRODUCT(410, "enum.biLink.name.idx_statistic_opp_product", XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_" + XbbRefTypeEnum.PRODUCT.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + SalesOpportunityEnum.PRODUCTS.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + SalesOpportunityEnum.PRODUCTS.getFieldType()+ "}" +
                      "}"),


    /**
     * 回款作为主表
     */
    IDX_STATISTIC_PAYMENT_INVOICE(506, "enum.biLink.name.idx_statistic_payment_invoice", XbbRefTypeEnum.PAYMENT_SHEET.getCode() + "_" + XbbRefTypeEnum.INVOICE.getCode(),
            "{\"" + XbbRefTypeEnum.PAYMENT_SHEET.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.INVOICE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + InvoiceEnum.PAYMENT_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + InvoiceEnum.PAYMENT_ID.getFieldType()+ "}" +
                        "}"),

    /**
     * 跟进记录作为主表
     */
//    IDX_STATISTIC_COMMUNICATE_CONTRACT(703, "跟进记录、合同",   XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode() + "_" + XbbRefTypeEnum.CONTRACT.getCode(), -1),

    /**
     * 供应商作为主表
     */
    IDX_STATISTIC_SUPPLIER_PURCHASE(1001, "enum.biLink.name.idx_statistic_supplier_purchase", XbbRefTypeEnum.SUPPLIER.getCode() + "_" + XbbRefTypeEnum.PURCHASE.getCode(),
            "{\"" + XbbRefTypeEnum.SUPPLIER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + PurchaseEnum.SUPPLIER_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + PurchaseEnum.SUPPLIER_ID.getFieldType()+ "}" +
                      "}"),
//    IDX_STATISTIC_SUPPLIER_INVENTORY_MANAGEMENT(1002, "idx_statistic_supplier_inventory_management", "supplier_inventory_management", "供应商、库存", XbbRefTypeEnum.SUPPLIER.getCode() + "_" + XbbRefTypeEnum.INVENTORY_MANAGEMENT.getCode(), -1),
/*    IDX_STATISTIC_SUPPLIER_PRODUCT(1003, "供应商、产品",  XbbRefTypeEnum.SUPPLIER.getCode() + "_" + XbbRefTypeEnum.PRODUCT.getCode(),
        "{\"" + XbbRefTypeEnum.SUPPLIER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
        + XbbRefTypeEnum.PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ProductEnum.SUPPLIER.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + ProductEnum.SUPPLIER.getFieldType()+ "}" +
        "}"),*/
    IDX_STATISTIC_SUPPLIER_RETURNED_PURCHASE(1001, "enum.biLink.name.idx_statistic_supplier_purchase", XbbRefTypeEnum.SUPPLIER.getCode() + "_" + XbbRefTypeEnum.RETURNED_PURCHASE.getCode(),
            "{\"" + XbbRefTypeEnum.SUPPLIER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.RETURNED_PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ReturnedPurchaseEnum.SUPPLIER_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + ReturnedPurchaseEnum.SUPPLIER_ID.getFieldType()+ "}" +
                    "}"),

    /**
     * 采购合同作为主表
     */
    IDX_STATISTIC_PURCHASE_RETURNED_PURCHASE(1101, "enum.biLink.name.idx_statistic_purchase_returned_purchase", XbbRefTypeEnum.PURCHASE.getCode() + "_" + XbbRefTypeEnum.RETURNED_PURCHASE.getCode(),
            "{\"" + XbbRefTypeEnum.PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.RETURNED_PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ReturnedPurchaseEnum.PURCHASE_SHEET_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + ReturnedPurchaseEnum.PURCHASE_SHEET_ID.getFieldType()+ "}" +
                    "}"),
    IDX_STATISTIC_PURCHASE_INSTOCK(1103, "enum.biLink.name.idx_statistic_purchase_instock",XbbRefTypeEnum.PURCHASE.getCode() + "_" + XbbRefTypeEnum.INSTOCK.getCode(),
            "{\"" + XbbRefTypeEnum.PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.INSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  InstockEnum.REF_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +  InstockEnum.REF_ID.getFieldType()+ "}" +
                       "}"),
/*    IDX_STATISTIC_PURCHASE_PRODUCT(1104, "采购合同、 产品", XbbRefTypeEnum.PURCHASE.getCode() + "_" + XbbRefTypeEnum.PRODUCT.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + PurchaseEnum.PRODUCT.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + PurchaseEnum.PRODUCT.getFieldType()+ "}" +
                    "}"),*/
    /**
     * 采购退货作为主表
     */
    IDX_STATISTIC_RETURNED_PURCHASE_OUTSTOCK(1202,  "enum.biLink.name.idx_statistic_returned_purchase_outstock", XbbRefTypeEnum.RETURNED_PURCHASE.getCode() + "_" + XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(),
            "{\"" + XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.RETURNED_PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ReturnedPurchaseEnum.OUTSTOCK_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + ReturnedPurchaseEnum.OUTSTOCK_ID.getFieldType()+ "}" +
                        "}"),
/*    IDX_STATISTIC_RETURNED_PURCHASE_PRODUCT(1203, "采购退货、 产品", XbbRefTypeEnum.RETURNED_PURCHASE.getCode() + "_" + XbbRefTypeEnum.PRODUCT.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.RETURNED_PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ReturnedPurchaseEnum.PRODUCTS.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + ReturnedPurchaseEnum.PRODUCTS.getFieldType()+ "}" +
                    "}"),*/
    /**
     * 库存作为主表
     */
//    IDX_STATISTIC_INVENTORY_MANAGEMENT_PRODUCT(1301, "idx_statistic_inventory_management_product", "inventory_management_product", "库存、 产品",  XbbRefTypeEnum.INVENTORY_MANAGEMENT.getCode() + "_" + XbbRefTypeEnum.PRODUCT.getCode(), -1),
//    IDX_STATISTIC_INVENTORY_MANAGEMENT_SUPPLIER(1302, "idx_statistic_inventory_management_supplier", "inventory_management_supplier", "库存、 供应商",  XbbRefTypeEnum.INVENTORY_MANAGEMENT.getCode() + "_" + XbbRefTypeEnum.SUPPLIER.getCode(), -1),
    /**
     * 入库单作为主表
     */
    IDX_STATISTIC_INSTOCK_PRODUCTION_ORDER(1403, "enum.biLink.name.idx_statistic_instock_production_order",   XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode() + "_" + XbbRefTypeEnum.PRODUCTION_ORDER.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  InstockEnum.REF_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +  InstockEnum.REF_ID.getFieldType()+ "}" +
                    "}"),
    IDX_STATISTIC_INSTOCK_RETURNED_MATERIEL(1404, "enum.biLink.name.idx_statistic_instock_returned_materiel",   XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode() + "_" + XbbRefTypeEnum.PRODUCTION_ORDER.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  InstockEnum.REF_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +  InstockEnum.REF_ID.getFieldType()+ "}" +
                    "}"),
    IDX_STATISTIC_INSTOCK_PUCHASE(1405, "enum.biLink.name.idx_statistic_instock_puchase",   XbbRefTypeEnum.PURCHASE_INSTOCK.getCode() + "_" + XbbRefTypeEnum.PURCHASE.getCode(),
            "{\"" + XbbRefTypeEnum.PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.PURCHASE_INSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  InstockEnum.REF_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +  InstockEnum.REF_ID.getFieldType()+ "}" +

                    "}"),
/*    IDX_STATISTIC_INSTOCK_PRODUCT(1404, "入库单、 产品",  XbbRefTypeEnum.INSTOCK.getCode() + "_" + XbbRefTypeEnum.PRODUCT.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.INSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + InstockEnum.PRODUCT.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + InstockEnum.PRODUCT.getFieldType()+ "}" +
                    "}"),*/
    /**
     * 出库单作为主表
     */
/*    IDX_STATISTIC_OUTSTOCK_PURCHASE(1501, "出库单、 采购合同",   XbbRefTypeEnum.OUTSTOCK.getCode() + "_" + XbbRefTypeEnum.PURCHASE.getCode(),
            "{\"" + XbbRefTypeEnum.OUTSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "}" +
                    + XbbRefTypeEnum.PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + PurchaseEnum.PRODUCT.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + PurchaseEnum.PRODUCT.getFieldType()+ "}" +
                    "}"),*/
    IDX_STATISTIC_OUTSTOCK_PRODUCTION_ORDER(1503,  "enum.biLink.name.idx_statistic_outstock_production_order",  XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode() + "_" + XbbRefTypeEnum.PRODUCTION_ORDER.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + OutstockEnum.REF_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + OutstockEnum.REF_ID.getFieldType()+ "}" +
                    "}"),
/*    IDX_STATISTIC_OUTSTOCK_PRODUCT(1504, "出库单、 产品",   XbbRefTypeEnum.OUTSTOCK.getCode() + "_" + XbbRefTypeEnum.PRODUCT.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.OUTSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + OutstockEnum.PRODUCT.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + OutstockEnum.PRODUCT.getFieldType()+ "}" +
                    "}"),*/
    /**
     * 产品作为主表
     */
    //
//    IDX_STATISTIC_PRODUCT_WAREHOUSE(1610, "idx_statistic_product_warehouse", "product_warehouse", "产品、库存", XbbRefTypeEnum.PRODUCT.getCode() + "_" +  XbbRefTypeEnum.WAREHOUSE.getCode(), -1),
//    IDX_STATISTIC_PRODUCT_WORKORDER(1613, "产品、工单", XbbRefTypeEnum.PRODUCT.getCode() + "_" +  XbbRefTypeEnum.WORK_ORDER.getCode(),
/*    IDX_STATISTIC_PRODUCT_PRODUCTION_ORDER(1618, "产品、生产单",XbbRefTypeEnum.PRODUCT.getCode() + "_" +  XbbRefTypeEnum.PRODUCTION_ORDER.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID .getType()+ "},\"" +
                    + XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + ProductionOrderEnum.PRODUCT.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + ProductionOrderEnum.PRODUCT.getFieldType()+ "}" +
                    "}"),*/

    IDX_STATISTIC_CONTRACT_PRODUCT(204, "enum.biLink.name.idx_statistic_contract_product",XbbRefTypeEnum.CONTRACT_PRODUCT.getCode() + "_" +  XbbRefTypeEnum.CONTRACT.getCode(),
            "{\"" + XbbRefTypeEnum.CONTRACT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.CONTRACT_PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + BIProductEnum.CONTRACT_PRODUCT.getLinkAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.LINK_BUSINESS_SINGLE.getType()+ "}" +
                    "}"),
/*    IDX_STATISTIC_INSTOCK_PRODUCT(1402, "enum.biLink.name.idx_statistic_instock_product",XbbRefTypeEnum.INSTOCK_PRODUCT.getCode() + "_" +  XbbRefTypeEnum.INSTOCK.getCode(),
            "{\"" + XbbRefTypeEnum.INSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.INSTOCK_PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + BIProductEnum.INSTOCK_PRODUCT.getLinkAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.LINK_BUSINESS_SINGLE.getType()+ "}" +
                    "}"),*/
    IDX_STATISTIC_SALES_OPPORTUNITY_PRODUCT(306, "enum.biLink.name.idx_statistic_sales_opportunity_product",XbbRefTypeEnum.SALES_OPPORTUNITY_PRODUCT.getCode() + "_" +  XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(),
            "{\"" + XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.SALES_OPPORTUNITY_PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + BIProductEnum.SALES_OPPORTUNITY_PRODUCT.getLinkAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.LINK_BUSINESS_SINGLE.getType()+ "}" +
                    "}"),
/*    IDX_STATISTIC_OUTSTOCK_PRODUCT(1502, "enum.biLink.name.idx_statistic_outstock_product",XbbRefTypeEnum.OUTSTOCK_PRODUCT.getCode() + "_" +  XbbRefTypeEnum.OUTSTOCK.getCode(),
            "{\"" + XbbRefTypeEnum.OUTSTOCK.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.OUTSTOCK_PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + BIProductEnum.OUTSTOCK_PRODUCT.getLinkAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.LINK_BUSINESS_SINGLE.getType()+ "}" +
                    "}"),
    IDX_STATISTIC_PRODUCTION_ORDER_PRODUCT(2802, "enum.biLink.name.idx_statistic_production_order_product",XbbRefTypeEnum.PRODUCTION_ORDER_PRODUCT.getCode() + "_" +  XbbRefTypeEnum.PRODUCTION_ORDER.getCode(),
            "{\"" + XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.PRODUCTION_ORDER_PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + BIProductEnum.OUTSTOCK_PRODUCT.getLinkAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.LINK_BUSINESS_SINGLE.getType()+ "}" +
                    "}"),
    IDX_STATISTIC_PURCHASE_PRODUCT(1104, "enum.biLink.name.idx_statistic_purchase_product",XbbRefTypeEnum.PURCHASE_PRODUCT.getCode() + "_" +  XbbRefTypeEnum.PURCHASE.getCode(),
            "{\"" + XbbRefTypeEnum.PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.PURCHASE_PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + BIProductEnum.OUTSTOCK_PRODUCT.getLinkAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.LINK_BUSINESS_SINGLE.getType()+ "}" +
                    "}"),*/
    IDX_STATISTIC_RETURNED_PURCHASE_PRODUCT(1202, "enum.biLink.name.idx_statistic_returned_purchase_product",XbbRefTypeEnum.RETURNEDPURCHASE_PRODUCT.getCode() + "_" +  XbbRefTypeEnum.RETURNED_PURCHASE.getCode(),
            "{\"" + XbbRefTypeEnum.RETURNED_PURCHASE.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.RETURNEDPURCHASE_PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + BIProductEnum.RETURNED_PURCHASE_PRODUCT.getLinkAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.LINK_BUSINESS_SINGLE.getType()+ "}" +
                    "}"),
    IDX_STATISTIC_SUPPLIER_PRODUCT(1005, "enum.biLink.name.idx_statistic_supplier_product",XbbRefTypeEnum.SUPPLIER_PRODUCT.getCode() + "_" +  XbbRefTypeEnum.SUPPLIER.getCode(),
            "{\"" + XbbRefTypeEnum.SUPPLIER.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.SUPPLIER_PRODUCT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + BIProductEnum.SUPPLIER_PRODUCT.getLinkAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.LINK_BUSINESS_SINGLE.getType()+ "}" +
                    "}"),

    /**
     * 报价单
     */
    IDX_STATISTIC_QUOTATION_OPP(4701, "enum.biLink.name.idx_statistic_quotation_opp",XbbRefTypeEnum.QUOTATION.getCode() + "_" +  XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(),
            "{\"" + XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.QUOTATION.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + QuotationEnum.OPPORTUNITY_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" +QuotationEnum.OPPORTUNITY_ID.getFieldType()+ "}" +
                    "}"),

    IDX_STATISTIC_QUOTATION_CUSTOMER(4702, "enum.biLink.name.idx_statistic_quotation_customer",XbbRefTypeEnum.QUOTATION.getCode() + "_" +  XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode(),
            "{\"" + XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" +  FieldTypeEnum.DATAID .getAlias()  + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + FieldTypeEnum.DATAID.getType()+ "},\"" +
                    + XbbRefTypeEnum.QUOTATION.getCode() + "\": { \"" + FieldAttrConstant.ATTR  + "\":\"" + QuotationEnum.CUSTOMER_ID.getAttr() + "\",\"" + FieldAttrConstant.FIELD_TYPE + "\":" + QuotationEnum.CUSTOMER_ID.getFieldType()+ "}" +
                    "}"),


    ;
    /**
     * 编号标示
     */
    private Integer code;
    /**
     * 名称
     */
    private String name;
    /**
     * 联合code
     */
    private String mutiCode;
    /**
     * 默认关联字段
     */
    private String defaultAttr;

    BiLinkEnum(Integer code, String name, String mutiCode, String defaultAttr) {
        this.code = code;
        this.name = name;
        this.mutiCode = mutiCode;
        this.defaultAttr = defaultAttr;
    }

    /**
     * 根据mutiCode获取枚举
     * @param mutiCode 联合code
     * @return
     */
    public static BiLinkEnum getByMutiCode(String mutiCode) {
        for (BiLinkEnum cacheCode : values()) {
            if (mutiCode.equals(cacheCode.getMutiCode())) {
                return cacheCode;
            }
        }
        return null;
    }

    /**
     * 根据code获取枚举
     * @param  code
     * @return
     */
    public static BiLinkEnum getByCode(Integer code) {
        for (BiLinkEnum cacheCode : values()) {
            if (code.equals(cacheCode.getCode())) {
                return cacheCode;
            }
        }
        return null;
    }

    public String getName() {
        return I18nMessageUtil.getMessage(name);
    }
}
